<template>
    <view
        @tap="__e"
        @touchmove.stop.prevent="__e"
        class="mask data-v-4eb9b52c"
        :data-event-opts="[
            ['tap', [['cancel', ['$event']]]],
            ['touchmove', [['', ['$event']]]]
        ]"
    >
        <view @tap.stop.prevent="__e" class="mask-content data-v-4eb9b52c" :data-event-opts="[['tap', [['', ['$event']]]]]" v-if="isInit && !isReturnSaleSuccess">
            <text @tap.stop.prevent="__e" class="new-iconfont icon-close close-btn data-v-4eb9b52c" :data-event-opts="[['tap', [['cancel', ['$event']]]]]"></text>
            <view class="title data-v-4eb9b52c">使用积分兑换次数</view>
            <view class="money-c data-v-4eb9b52c">
                <view class="input-c data-v-4eb9b52c">
                    兑换
                    <input
                        @blur="__e"
                        @input="__e"
                        class="input score-input data-v-4eb9b52c"
                        :data-event-opts="[
                            ['input', [['__set_model', ['', 'total', '$event', ['number']]]]],
                            ['blur', [['$forceUpdate']]]
                        ]"
                        :value="total"
                    />
                    次
                </view>
                <view class="data-v-4eb9b52c">
                    {{ '' + scorePrice + scoreAlias + '/次，总计' }}
                    <label class="total _span data-v-4eb9b52c">{{ scorePrice * total }}</label>
                    {{ scoreAlias + '' }}
                </view>
            </view>
            <view class="btn-c data-v-4eb9b52c">
                <button @tap="__e" class="btn cancel bg-purple data-v-4eb9b52c" :data-event-opts="[['tap', [['cancel', ['$event']]]]]">再想想</button>
                <button @tap="__e" class="btn submit bg-yellow data-v-4eb9b52c" :data-event-opts="[['tap', [['submit', ['$event']]]]]">确认兑换</button>
            </view>
        </view>
    </view>
</template>

<script>
import tabBar from '@/components/TabBar/tabBar';
(global.webpackJsonp = global.webpackJsonp || []).push([
    ['components/BuyActivityTicket/BuyActivityTicket'],
    {
        '5bfb': function (t, n, i) {
            'use strict';

            i.r(n);
            var e = i('c07c');
            var c = i.n(e);
            for (var o in e) {
                if (['default'].indexOf(o) < 0) {
                    (function (t) {
                        i.d(n, t, function () {
                            return e[t];
                        });
                    })(o);
                }
            }
            n.default = c.a;
        },
        '86ca': function (t, n, i) {},
        '879b': function (t, n, i) {
            'use strict';

            var e = i('86ca');
            i.n(e).a;
        },
        b405: function (t, n, i) {
            'use strict';

            i.r(n);
            var e = i('e394');
            var c = i('5bfb');
            for (var o in c) {
                if (['default'].indexOf(o) < 0) {
                    (function (t) {
                        i.d(n, t, function () {
                            return c[t];
                        });
                    })(o);
                }
            }
            i('879b');
            var u = i('f0c5');
            var a = Object(u.a)(c.default, e.b, e.c, false, null, '4eb9b52c', null, false, e.a, void 0);
            n.default = a.exports;
        },
        c07c: function (t, n, i) {
            'use strict';

            (function (t) {
                Object.defineProperty(n, '__esModule', {
                    value: true
                });
                n.default = void 0;
                var i = {
                    components: {},
                    data: function () {
                        return {
                            info: {},
                            isInit: false,
                            scorePrice: 10,
                            total: 1
                        };
                    },
                    props: {
                        nodeType: {
                            type: String
                        },
                        nodeUuid: {
                            type: String
                        }
                    },
                    computed: {},
                    watch: {},
                    onLoad: function (t) {},
                    created: function () {
                        this.initData();
                    },
                    methods: {
                        switchChange: function (t) {
                            this.isUseAdvisePrice = t.detail.value ? 1 : 0;
                        },
                        initData: function () {
                            var that = this;
                            t.showLoading();
                            this.$http('/activity/buy-ticket/preview', 'post', {
                                node_type: this.nodeType,
                                node_uuid: this.nodeUuid
                            }).then(function (i) {
                                that.isInit = true;
                                that.info = i.data.info;
                                that.scorePrice = that.info.score_price;
                                t.hideLoading();
                            });
                        },
                        cancel: function () {
                            this.$emit('cancel');
                        },
                        submit: function () {
                            var that = this;
                            this.total ||
                                t.showToast({
                                    title: '请输入兑换次数',
                                    icon: 'none'
                                });
                            t.showLoading();
                            this.$http('/activity/buy-ticket', 'post', {
                                node_type: this.nodeType,
                                node_uuid: this.nodeUuid,
                                total: this.total
                            }).then(function (i) {
                                t.hideLoading();
                                that.$emit('success');
                            });
                        },
                        toPage: function (n) {
                            t.navigateTo({
                                url: n
                            });
                        }
                    },
                    onPageScroll: function (t) {}
                };
                n.default = i;
            }.call(this, i('543d').default));
        },
        e394: function (t, n, i) {
            'use strict';

            i.d(n, 'b', function () {
                return e;
            });
            i.d(n, 'c', function () {
                return c;
            });
            i.d(n, 'a', function () {});
            var e = function () {
                this.$createElement;
                this._self._c;
            };
            var c = [];
        }
    }
]);
(global.webpackJsonp = global.webpackJsonp || []).push([
    'components/BuyActivityTicket/BuyActivityTicket-create-component',
    {
        'components/BuyActivityTicket/BuyActivityTicket-create-component': function (t, n, i) {
            i('543d').createComponent(i('b405'));
        }
    },
    [['components/BuyActivityTicket/BuyActivityTicket-create-component']]
]);
</script>
<style>
@import './BuyActivityTicket.css';
</style>
